package com.example.librarysystem.Dao;

import com.example.librarysystem.entity.Comment;
import com.example.librarysystem.entity.CommentInfo;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("commentDao")
public interface CommentDao {
    Integer selectCount();
    Integer selectCountByBookName(String bookName);
    List<Comment> selectByBookName(String bookName);
    List<Comment> selectByBorrowerName(String borrowerName);
    Comment selectCommentById(int id);
    List<CommentInfo> selectCommentInfo(int borrowerId, int currentPage, int pageSize);
    List<CommentInfo> selectCommentInfoSearch(int borrowerId, String bookName, String author, String publishingHouse, int currentPage, int pageSize);
    int selectCommentInfoCount(int borrowerId);
    int selectCommentInfoSearchCount(int borrowerId, String bookName, String author, String publishingHouse);
    void updateCommentById(int id, String content, int score);
    void deleteCommentById(int id);
    Comment selectCommentByBookAndBorrower(String bookName, int borrowerId);
    int selectExist(String bookName, int borrowerId);
    void insertComment(Comment comment);
    List<Comment> selectAll(int currentPage, int pageSize);
}
